﻿/***********************************
//布置作业模块
***********************************/

Ext.namespace('EHSubmit.Goal.PublishObj');


EHSubmit.Goal.PublishObj.detailsReset = function(){
    // grid下方展示的刷新
    var tpl = new Ext.XTemplate();
    var detailQesPanel = Ext.getCmp('detailQesPanel');
    tpl.overwrite(detailQesPanel.body,'[]');
}


//// 选择要布置作业的班级窗体
Ext.namespace('EHSubmit.Goal.PublishObj.ChooseForm');

//列模式
EHSubmit.Goal.PublishObj.ChooseForm.ColumnModel = new Ext.grid.ColumnModel([
    { header: '班级ID', width: 40, sortable: true, hidden: true, dataIndex: 'Id' },
    { header: '班级名', width: 100, sortable: true, hidden: false, dataIndex: 'Name' }
    
]);


// 数据源
EHSubmit.Goal.PublishObj.ChooseForm.DataStore = new Ext.data.Store({
    baseParams: { Op: 'listCourses', tid: '20' },      // 需要传递操作参数  tid教师的ID
    proxy: new Ext.data.HttpProxy({ url: EHSubmit.ajaxRoot + 'UploadHandler.ashx' }),  //后台具体处理  

    reader: new Ext.data.JsonReader({
        totalProperty: 'count',    //总记录个数
        root: 'data',
        id: 'Id'
    },
        [   // 数据模型
            { name: 'Id' },
            { name: 'Name' },
            { name: 'CourseTypeID'}
    ]),
    listeners: {
        /// 加载异常处理
        exception: function(proxy, type, action, options, response) {
            Ext.MessageBox.alert('数据加载错误!', '请与管理员联系');

        }
    }
});

EHSubmit.Goal.PublishObj.ChooseForm.GridPanel = {
    xtype: 'grid',
    //title: '选择班级',
    id: 'PublishObj_ChooseGrid',
    frame: false,
    border: false,
    flex:1,
    margins:'0,0,0,0',
    autoExpandColumn: 1, 
    //autoHeight: true,       // 自动调整高度
    //height: 330,
    loadMask: true,           // 加载数据时遮住
    ds: EHSubmit.Goal.PublishObj.ChooseForm.DataStore,
    cm: EHSubmit.Goal.PublishObj.ChooseForm.ColumnModel,
    sm: new Ext.grid.RowSelectionModel({
        singleSelect: true,              // 一次只选一个
        listeners: {
            /// 选中一个作业,在右边显示相关信息
            rowselect: function(sm, row, rec) {
                ///// 显示当前选择的作业
//                var form = Ext.getCmp('doPublishForm');
//                form.enable();

//                form.getForm().findField('courseId').setValue(rec.get('Id'));
//                form.getForm().findField('goalTitle').setValue(rec.get('Name') + '-未命名作业');
            }
        }
    }),
    listeners: {
        render: function(thisGrid) {
            //----------请求单页数据-----------------
            thisGrid.store.load();
        },
        rowclick:function (thisGrid,rowIndex,e ){
            ///// 显示当前选择的作业
            var form = Ext.getCmp('doPublishObjForm');
            form.enable();
            Ext.getCmp('qesManagerTab').enable();
            
            var store = thisGrid.getStore();
            var rec = store.getAt(rowIndex);

            form.getForm().findField('courseId').setValue(rec.get('Id'));
            form.getForm().findField('goalTitle').setValue(rec.get('Name') + '-未命名作业');

            //----给习题库添加新习题时需要------
            EHSubmit.Goal.Question.BaseCourseID = rec.get('CourseTypeID');
        },
        //        render: function(g) {
        //            g.getSelectionModel().selectRow(0);
        //        },
        delay: 10 // Allow rows to be rendered.
    }

};


//////////////////////////////////////////////////////////////////////
//// 填写作业信息,文件等
EHSubmit.Goal.PublishObj.PublishForm = {
    xtype: 'form',
    flex:2,
    id: 'doPublishObjForm',
    //autoHeight:true,
    //height: 330,
    disabled: true,      // 未选择任何作业时不能提交
    //title: '布置作业',
    fileUpload: true,    // 上传Form
    labelAlign: 'left',
    buttonAlign: 'center',
    bodyStyle: 'padding:15px;',
    frame: false,
    border: false,
    labelWidth: 80,
    monitorValid: true,

    defaults: { anchor: '95%', allowBlank: false, msgTarget: 'side' },
    items: [
        { // 作业信息
            xtype: 'textfield',
            name: 'goalTitle',
            blankText: '请在左边列表中选择一个班级',
            fieldLabel: '作业信息'
        },
        { // 隐藏域,保存GID
            xtype: 'hidden',
            name: 'courseId'
        },
        { // 上交期限
            xtype: 'datefield',
            name: 'deadline',
            format: 'Y年n月j日',
            blankText: '请选择最迟上交时间',
            fieldLabel: '最迟上交期限'
        },
        
//        { // 文件上传
//            xtype: 'fileuploadfield',
//            emptyText: '选择一个文件',
//            fieldLabel: '参考资料',
//            name: 'filePath',
//            allowBlank: true,
//            buttonText: ' 浏览... '
//            //            buttonCfg: {
//            //                iconCls: 'upload-icon'
//            //            }

//        },
        { // 作业说明字段
            xtype: 'textarea',
            fieldLabel: '作业说明',
            emptyText: '这里填写作业说明',
            name: 'description',
            blankText: '请填写此次作业的说明',
            height: 150,
            enableAlignments: false,
            enableLists: false
            //value: 'test'
        }
    ],
    buttons: [{
        text: '确定',
        handler: function() {
            var frm = Ext.getCmp('doPublishObjForm');
            var QIDs = new Array();
            var QIDList = null;
            if(EHSubmit.Goal.Question.qesStore.getCount() > 0){
                QIDs = EHSubmit.Goal.Question.qesStore.collect('QID');
                QIDList = Ext.util.JSON.encode(QIDs);
                
                if (frm.getForm().isValid()) { // 验证表单
                    frm.getForm().submit({     // 提交
                        url: EHSubmit.ajaxRoot + 'GoalHandler.ashx?op=addObjGoal',
                        waitTitle: '等待',
                        waitMsg: '正在上传,请稍后...',
                        method: 'POST',
                        params: {
                            qesList: QIDList,
                        },
                        success: function(form, action) {
                            var successed = action.result.success;
                            if (successed) {
                                ///////////////  提交成功处理  ///////////////////
                                Ext.MessageBox.alert('提示', '提交成功！');
                                frm.disable();

                                // 清除表单内容
                                frm.getForm().reset();
                                Ext.getCmp('qesManagerTab').disable();
                                // 清除上次goal的习题，刷新预览
                                EHSubmit.Goal.Question.qesStore.removeAll();
                                EHSubmit.Goal.Question.preview();
                            }
                            else {
                                Ext.MessageBox.alert('失败', '信息：' + action.result.msg);
                            }
                        },
                        failure: function(form, action) {
                            var errmsg = action.result.msg;
                            Ext.MessageBox.alert('错误', errmsg);
                        }   // failure  
                    });
                } /// if is Valid
            }
            else{
                Ext.MessageBox.alert('提示', '您尚未布置习题!');
            }
        }
    }, {
        text: '习题重置',
        handler: function() {
            EHSubmit.Goal.Question.qesStore.removeAll();
            EHSubmit.Goal.Question.preview();
        }
    }]

  
};

EHSubmit.Goal.PublishObj.WestArea = {
    xtype:'panel',
    title: '选择班级并布置作业',
    frame: true,
    margins: '3 -2 3 3',
    region: 'west',
    width: 400,
    collapsible: true,
    //---折叠后的margins
    cmargins: '3 3 3 3',
    split: true,
    layout:'vbox',
    layoutConfig: {
        align : 'stretch',
        pack  : 'start',
    },
    items:[EHSubmit.Goal.PublishObj.ChooseForm.GridPanel,EHSubmit.Goal.PublishObj.PublishForm] 

};


EHSubmit.Goal.PublishObj.CentralArea = {
	xtype: 'tabpanel',
	id:'qesManagerTab',
	region: 'center',
	disabled:true,
	margins: '3 3 3 0',
	tabPosition: 'bottom',
	activeTab: 0,
	items: [{
	    //布置客观题作业的子tab 
		title: '习题管理',
		layout: 'ux.center',
		frame:false,
		//width: '95%',
		bodyStyle: 'padding:20px 0;',
		//margins:'10 auto',
		border: false,

		items: {
    	    frame: false,
    	    //autoHeight: true,
    	    //layout: 'ux.center',
		    width: '93%',
		    border:false,
    	    layout:'hbox',     ///**********其中两个panel不会随着该panel的变化而变化
    	    height:500,
    	    layoutConfig: {
                align : 'stretch',
                pack  : 'start'
            },
            items: [
            {   //搜索结果panel
                xtype:'panel',
                flex:2,
                height:450,
                layout:'vbox',
                layoutConfig: {
                    align : 'stretch',
                    pack  : 'start'
                },
                items:[
                {
                    //------搜索结果panel的上半部分，对搜索结果的查看grid
                    xtype:'grid',
                    id:'searchQesGrid',
                    region:'north',
                    flex:2,
                    title:'搜索结果',
                    tbar:{
                        enableOverflow: true,
                        items:[
                        {
                            text:'添加习题',
                            ref: '../addMenuButton',
                            iconCls: 'list',        // <-- icon
                            menu:{       // assign menu by instance
                                xtype:'menu',
                                //ref: '../addMenu',
                                style: {
                                    overflow: 'visible'     // For the Combo popup
                                }, 
                                items:[
                                {
                                    text: '添加当前习题至作业',
                                    tooltip: '添加当前习题至作业',
                                    disabled: true,
                                    itemId:'addToGoalButton',
                                    iconCls: 'icon-write',
                                    handler: function(){
                                        var qesSreachStore = Ext.getCmp('searchQesGrid').getStore();
                                        var selectedRecIndex = EHSubmit.Goal.Question.selectedRecIndex;
                                        var qesSelected = qesSreachStore.getAt(selectedRecIndex);
                                        var isFound = false;
                                        
                                        //-----判断作业中是否已经有习题----
                                        if(EHSubmit.Goal.Question.qesStore.getCount() > 0){
                                            var qesMatchedIndex = EHSubmit.Goal.Question.qesStore.findExact('QID',qesSelected.data.QID);
                                            //----判断该习题是否已在作业中存在
                                            if(qesMatchedIndex == -1){
                                                EHSubmit.Goal.Question.qesStore.addSorted(qesSelected);
                                                isFound = false;
                                            }
                                            else{
                                                Ext.MessageBox.alert('失败', '该习题已在作业中存在!' );
                                                isFound = true;
                                            }
                                        }
                                        else{
                                            EHSubmit.Goal.Question.qesStore.addSorted(qesSelected);
                                            isFound = false;
                                        }
                                        
                                        if(!isFound){
                                            EHSubmit.Goal.Question.preview();
                                            Ext.MessageBox.alert('提示', '该习题成功添入作业!' );
                                        }                
                                    }
                                },{
                                    text: '添加新习题',
                                    tooltip: '添加新习题',
                                    iconCls: 'icon-write',
                                    handler: function(){
                                        EHSubmit.showWin(EHSubmit.Goal.Question.addQesWin);
                                    }
                                }
                                ]
                            }           
                        }, '-',
                        {                        
                            text: '更新当前习题(待实现)',
                            tooltip: '更新当前习题',
                            ref:'../updateQesButton',
                            iconCls: 'icon-write',
                            disabled: true
                            //handler: EHSubmit.MessageBox.Inbox.writeMsg
                        }, '-', {               
                            text: '删除当前习题',
                            tooltip: '删除当前习题',
                            ref:'../removeQesButton',
                            iconCls: 'remove',
                            disabled: true,
                            handler: function(button, e){
                                var thisGrid = button.ownerCt.ownerCt;

                                Ext.Msg.show({
                                        title: '提示',
                                        msg: '如果删除,习题将无法恢复,您确定吗?',
                                        buttons: Ext.Msg.YESNO,
                                        fn: function(buttonId, text, opt) {
                                            if (buttonId == 'yes') {                     
                                                var qesIDSelected = null;
                                                var count = thisGrid.selModel.getCount();
                                                var qesSelectedList = thisGrid.selModel.getSelections();
                                                if (qesSelectedList[0]) {
                                                    qesIDSelected = qesSelectedList[0].data.QID;
                                                    
                                                    Ext.Ajax.request({
                                                        url: EHSubmit.ajaxRoot + 'QuestionHandler.ashx',
                                                        params: { Op: 'removeQes', qesID: qesIDSelected},

                                                        success: function(response, opts) {
                                                            var result = Ext.decode(response.responseText).msg;
                                                            Ext.MessageBox.alert("提示", result);
                                                            //-------删除成功后，要刷新一下grid和其下方的detailpanel----------
                                                            thisGrid.store.remove(qesSelectedList);    
                                                            EHSubmit.Goal.PublishObj.detailsReset();
                                                        },
                                                        failure: function(response, opts){
                                                            var result = Ext.decode(response.responseText).msg;
                                                            Ext.MessageBox.alert('错误',result);
                                                        }
                                                    });
                                                }
                                            }
                                        },
                                        animEl: 'elId',
                                        icon: Ext.MessageBox.WARNING
                                });
                            }
                        }]  //---toolbar item end     
                    },   //---toolbar end  
                    cm: new Ext.grid.ColumnModel([
                        { header: '习题ID', dataIndex: 'QID', hidden: true, hideable: false },
                        { header: '习题类型', dataIndex: 'Type', width: 70,renderer: EHSubmit.Format.typeRenderer},
                        { header: '答对人数', dataIndex: 'RightCount',width: 70},
                        { header: '答错人数', dataIndex: 'WrongCount',width: 70},
                        { header: '答对率', dataIndex: 'Rate', width: 60},
                        //{ header: '创建者姓名', dataIndex: 'OwnerName',width: 80},
                        { header: '更新日期', dataIndex: 'UpdateTime',width: 80, renderer: Ext.util.Format.dateRenderer('Y年m月d日')}
                    ]),
                    sm: new Ext.grid.RowSelectionModel({
					    singleSelect: true
				    }),
                    ds: new Ext.data.Store({
                        //baseParams: { Op: 'listCourses', tid: '20' },      // 需要传递操作参数  tid教师的ID
                        //proxy: new Ext.data.HttpProxy({ url: EHSubmit.ajaxRoot + 'QestionHandler.ashx' }),  //后台具体处理  

                        reader: new Ext.data.JsonReader({
                            //totalProperty: 'count',    //总记录个数
                            root: 'data',
                            //id: 'Id'
                        },
                        [   // 数据模型
                            { name: 'QID' },
                            //{ name: 'OwnerName'},
                            { name: 'OwnerID' },
                            { name: 'Type'},
                            { name: 'Content'},
                            { name: 'Answer'},
                            { name: 'UpdateTime' },
                            { name: 'RightCount'},
                            { name: 'WrongCount' },
                            { name: 'Rate' },
                            { name: 'Institute'},    
                            { name: 'Department'},
                            { name: 'Options'}
                        ]),
                    }),
                    listeners: {
                        rowclick:function (thisGrid,rowIndex,e ){
                            thisGrid.addMenuButton.menu.getComponent('addToGoalButton').enable();
                            //暂未实现
                            //thisGrid.updateQesButton.enable();
                            thisGrid.removeQesButton.enable();
                            
                            //----针对当前记录的添加、更新、删除行为需要-----
                            EHSubmit.Goal.Question.selectedRecIndex = rowIndex;
                            
                            ///// 显示当前选择的作业
                            var recData = thisGrid.getStore().getAt(rowIndex).data;

                            var tpl = new Ext.XTemplate(
                                '<p style="text-align:left"> {Content}</p>',
                                '<tpl for="Options">',     // interrogate the kids property within the data
                                    '<p style="text-align:left">{Label}:{Content}</p>',
                                '</tpl></p>'
                            );
                            var detailQesPanel = Ext.getCmp('detailQesPanel');
                            tpl.overwrite(detailQesPanel.body,recData);
//                            detailQesPanel.removeAll(true);
//                            detailQesPanel.add(new Ext.ux.Question({qType:recData.Type, order:1, qTitle:recData.Content, qId: recData.QID, qBody:recData.Options}));
//                            detailQesPanel.doLayout();
                        },
                        /// 加载异常处理
                        exception: function(proxy, type, action, options, response) {
                            Ext.MessageBox.alert('数据加载错误!', '请与管理员联系');

                        }
                    }
                },  // 搜索结果panel的上半部分grid end
                {
                    // 搜索结果panel的下半部分，详细查看
                    id: 'detailQesPanel',
				    region: 'center',
				    layout:'form',
				    autoScroll:true,
				    flex:1,
				    bodyStyle: {
					    background: '#ffffff',
					    padding: '7px'
				    }
                }]   // 搜索结果panel的下半部分 end
            }, //搜索结果panel end
            {
                //---检索框-------
                xtype:'form',
                id:'searchQesForm',
                title:'搜索栏',
                frame:true,
                flex:1,
                defaultType: 'textfield',
                labelWidth: 30,
                labelAlign: 'left',
		        //layout:'ux.center',
                //width: 330,
                items:[
                {
                    xtype:'label',
                    text:'基于您添加过的习题'               
                },
                {
                    xtype: 'fieldset',
                    title:'基本搜索',
                    collapsible:true,
                    collapsed:false,
                    defaults: {width: 120, border:false},    // Default config options for child items
                    autoHeight: true,
                    border: false,
                    //labelWidth:53,
                    items: [
                    {
                        xtype: 'combo',
                        id:'baseCourseCombo',
                        listWidth:120,
                        hiddenName: 'baseCourseID',
                        fieldLabel: '课程',
                        editable: false,
                        emptyText: '请选择...',
                        mode: 'remote',
                        triggerAction: 'all',
                        selectOnFocus: true,
                        valueField: 'baseCourseID',
                        displayField: 'baseCourseName',

                        store: new Ext.data.JsonStore({
                            storeId: 'courseStore',
                            //autoLoad: true,
                            baseParams: { Op: 'List_TeacherBaseCourse' },     //根据教师id获取其教的课程
                            proxy: new Ext.data.HttpProxy({ url: EHSubmit.ajaxRoot + 'CourseHandler.ashx' }),  //后台具体处理
                            
                            root:'baseCourses',
                            fields: [
                                { name: 'baseCourseID', mapping: 'ID' },
                                { name: 'baseCourseName', mapping: 'Name' }
                            ]
                        }),
                        listeners: {
                            select: function(combo, record, index) {
                                //---搜索按钮可用-----
                                combo.ownerCt.ownerCt.searchButton.enable();
                            }
                        }
                    }
                    ]
                },    //上半部分fieldset end
               {
                    xtype:'label',
                    text:'基于题库(暂不实现)'
                },
                {
                    xtype: 'fieldset',
                    title:'高级搜索',      //一旦利用了高级搜索，要使基本搜索不可用
                    collapsible:true,
                    collapsed:true,
                    disabled:true,
                    width:200,
                    defaults: {width: 100, border:false},    // Default config options for child items
                    autoHeight: true,
                    border: false,
                    labelWidth: 53,
                    items: [{
                        xtype: 'combo',
                        id:'instituteCombo',
                        //hiddenName: 'institute',
                        fieldLabel: '学院',
                        editable: false,
                        emptyText: '请选择...',
                        mode: 'remote',
                        triggerAction: 'all',
                        selectOnFocus: true,
                        valueField: 'instituteID',
                        displayField: 'instituteName',

                        store: new Ext.data.JsonStore({
                            storeId: 'instituteStore',
                            //autoLoad: true,
                            baseParams: { Op: 'List_Institute' },     //根据教师id获取其教的课程
                            //proxy: new Ext.data.HttpProxy({ url: EHSubmit.ajaxRoot + 'CourseHandler.ashx' }),  //后台具体处理

                            root: 'courses',
                            fields: [
                                { name: 'instituteID', mapping: 'InstituteID' },
                                { name: 'instituteName', mapping: 'InstituteName' }
                            ]
                        }),

                        listeners: {
                            select: function(combo, record, index) {
                                //根据学院Id获取专业信息
                                Ext.getCmp('deptCombo').clearValue();
                                Ext.getCmp('deptCombo').enable();
                            }
                        }
                    },{
                        xtype: 'combo',
                        id:'deptCombo',
                        //hiddenName: 'department',
                        fieldLabel: '专业',
                        disabled: true,     //初始化时不可用，选择课程后可用
                        editable: false,
                        emptyText: '请选择...',
                        //mode: 'remote',
                        triggerAction: 'all',
                        selectOnFocus: true,
                        valueField: 'deptID',
                        displayField: 'deptName',

                        store: new Ext.data.JsonStore({
                            storeId: 'deptStore',
                            autoLoad: false,
                            baseParams: { Op: 'List_Depts', insID: '' },
                            proxy: new Ext.data.HttpProxy({ url: EHSubmit.ajaxRoot + 'GoalHandler.ashx' }),  //后台具体处理

                            root: 'depts',
                            fields: [
                                { name: 'deptID', mapping: 'DepartmentID' },
                                { name: 'deptName', mapping: 'DepartmentName' }
                            ]
                        }),

                        listeners: {
                            enable: function(combo) {
                                //将学院id传给服务器端
                                var store = combo.getStore();
                                var insID = Ext.getCmp('instituteCombo').getValue();
                                store.setBaseParam('insID',insID);
                            }
                        }
                    },{
                        xtype: 'textfield',
                        //hiddenName: 'sex,'
                        fieldLabel: '主关键字',
                        emptyText: '请填写',
                        allowBlank: true
                    },{
                        xtype: 'textfield',
                        //hiddenName: 'sex',
                        fieldLabel: '次关键字',
                        emptyText: '请填写',
                        allowBlank: true
                    }]
                }   //下半部分fieldset end
                ],
                //---检索框下确定搜索的按钮
                buttons: [{
                    text: '开始搜索',
                    ref: '../searchButton',
                    disabled:true,
                    handler: function() {
                        //-----grid上的按钮重新置为不可用
                        var searchQesGrid = Ext.getCmp('searchQesGrid');
                        searchQesGrid.addMenuButton.menu.getComponent('addToGoalButton').disable();
                        searchQesGrid.updateQesButton.disable();
                        searchQesGrid.removeQesButton.disable();
                        //----grid下方detailPanel的刷新
                        EHSubmit.Goal.PublishObj.detailsReset();
                        
                        var frm = Ext.getCmp('searchQesForm');
                        
                        if (frm.getForm().isValid()) {  //验证
                            frm.getForm().submit({  //提交
                                url: EHSubmit.ajaxRoot + 'QuestionHandler.ashx?Op=searchQes',
                                waitTitle: '等待',
                                waitMsg: '正在搜索，请稍后...',
                                method: 'POST',
                                success: function(form, action) {
                                    var successed = action.result.success;
                                    if (successed) {
                                        //如果有数据传回，grid载入数据 
                                        if(action.result.data[0]){
                                            Ext.getCmp('searchQesGrid').getStore().loadData(action.result);
                                        
//                                        var a = Ext.getCmp('searchQesGrid').getStore().getAt(0).data;
//                                        var b = a.Options[1].QID;
//                                        alert(b);
                                        }
                                        else{
                                            Ext.MessageBox.alert('提示', '无相关习题!');
                                            // grid和其下方展示的刷新
                                            Ext.getCmp('searchQesGrid').getStore().removeAll();
                                            EHSubmit.Goal.PublishObj.detailsReset();
                                        }
                                    }
                                    else {
                                        Ext.MessageBox.alert('失败', '信息:' + action.result.msg);
                                    }
                                },
                                failure: function(form, action) {
                                    var errmsg = null;
                                    switch (action.failureType) {
                                        case Ext.form.Action.CLIENT_INVALID:
                                            errmsg = 'Form fields may not be submitted with invalid values';
                                            break;
                                        case Ext.form.Action.CONNECT_FAILURE:
                                            errmsg = 'Ajax communication failed';
                                            break;
                                        case Ext.form.Action.SERVER_INVALID:
                                            errmsg = action.result.msg;
                                    }
                                    Ext.MessageBox.alert('错误', errmsg);
                                }   // failure  
                            })
                        }
                    }
                }]  //---检索框下确定搜索的按钮 end
            }   //检索框panel end
            ]   //用于放搜索结果panel和检索框panel的居中panel，用hbox布局  end
        } //布置客观题作业的子tab中的item end
    },
    {
		title: '习题预览',
		//bodyStyle:'padding:10px 10px 10px 0',
		padding:10,
		//layout: 'ux.center',
		autoScroll:true,
		
		items: {
		    id:'qesPreviewForm',
		    autoHeight:true,
		    width:'85%',
			border: false
		}
	}
    ]		    
}


//-------容器--------------
EHSubmit.Goal.PublishObj.Tab = {
    id: 'publishObjForm',
    title: '布置作业(客)',
    layout: 'border',
    frame: false,
    border: false,
    closable: true,
    //plain:false,
    //bodyStyle: 'padding:5px;',
    items: [EHSubmit.Goal.PublishObj.WestArea, EHSubmit.Goal.PublishObj.CentralArea],

    listeners: {
        //        activate:function(){
        //            alert('ac');
        //        },
        //--界面初始化------
        render: function() {
            //----清空，防止前面某次作业布置未完成后退出后残留
            EHSubmit.Goal.Question.qesStore.removeAll();
        }
//            var courseChartPanel = Ext.getCmp('analysis_CourseChartPanel');
//            courseChartPanel.show();
//            courseChartPanel.getComponent('tipLabel').hide();
//            courseChartPanel.getComponent('detailsButton').hide();
//            Ext.getCmp('analysis_GoalChartPanel').hide();
//            //表格和图的store的清除
//            var courseChart = Ext.getCmp('analysis_course_chart');
//            courseChart.store.removeAll();
//            Ext.getCmp('Analysis_WorkListGrid').store.removeAll();
//            //alert('asd');
//        }
        //        tabchange:function(){
        //            alert('tc');
        //        }
    }
};